﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace URM_SVN
{
    public class Urm
    {

        List<int> Data = new List<int>();

        public void Set(int _index, int _value)
        {
            for (int i = Data.Count; i < _index; i++)
            {
                Data.Add(0);
            }

            Data[_index - 1] = _value;
            /* TODO: set [_value] to the register[_index] */
        }

        public int Get(int _index)
        {
            if (_index > Data.Count)
            {
                return 0;
            }
            else
            {
                return Data[_index - 1];//this is fake return;
            }
            /* TODO: get value from  register[_index], and return it */
        }

        public void Copy(Urm _source)
        {
            Data.CopyTo(_source.GetAll());
            /* TODO: Read data from [_source] and save it in this object */
        }

        public int[] GetAll()
        {
            return Data.ToArray();
        }
    }
}


